﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IronController : MonoBehaviour
{
    GameBoard gameBoard;
    public float hp = 100f;

    private void Awake()
    {
        gameBoard = GameObject.Find("Board").GetComponent<GameBoard>();
        hp = 100f;
    }
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {        
    }

    void getHurt(int hurt) {
        hp -= hurt;
    }

    public void GetHurt(int hurt) {
        hp -= hurt;
        //Debug.Log(hp);
        if (hp <= 0) {
            gameBoard.removeBlock(transform.localPosition);
        }
    }
}
